var table,$;
layui.use(['table','jquery'],function () {
    jquery = layui.jquery;
    table = layui.table;
    getTableData();
})

//获取登录日志表格数据
function getTableData() {
    $.ajax({
        url:'/loginRecord/getLoginRecordTable',
        type: "post",
        dataType:'json',
        data: {},
        success:function(data){
            showTable(data.data);
            console.log(data.data);
        }
    })
}

//表格渲染
function showTable(data) {
    table.render({
        elem: '#test',
        data: data,
        page: true,
        limit: 10,
        cols:
            [[
                {field:'loginDate',title:'登陆时间',align:'center'},
                {field:'loginIp',title:'登陆IP',align:'center'},
                {field:'loginAddress',title:'登陆地区',align:'center'},
            ]]
    })
}